//
//  ShopCarTableViewCell.m
//  groupProject
//
//  Created by mac on 15/12/17.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "ShopCarTableViewCell.h"
#import "Config.h"

@implementation ShopCarTableViewCell {
    
}
@synthesize ReduceButton;
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle: style reuseIdentifier:reuseIdentifier];
    //selectButton
    self.selectButton = [[UIButton alloc] initWithFrame:CGRectMake(SPACING, SPACING*3, SPACING*2, SPACING*2)];
    _selectButton.layer.borderWidth = 1.0;
    _selectButton.layer.borderColor = [UIColor blackColor].CGColor;
    
    [_selectButton setBackgroundImage:[UIImage imageNamed:@"selectButton.png"] forState:UIControlStateNormal];

    [self.contentView addSubview:self.selectButton];
    
    //ImageView
    self.SCImageView  = [[UIImageView alloc]init];
    self.SCImageView.frame = CGRectMake(SPACING+40, SPACING, 80, 60);
    [self.contentView addSubview:self.SCImageView];
    
    //label
    self.SCLabel = [[UILabel alloc]init];
    self.SCLabel.frame = CGRectMake(130, SPACING,120, 60);
    self.SCLabel.numberOfLines = 0;
    [self.contentView addSubview:self.SCLabel];
    
    //price区域
    //减按钮
    self.ReduceButton = [[UIButton alloc] initWithFrame:CGRectMake(260, 30, 20, 20)];
    ReduceButton.layer.cornerRadius = 10;
   ReduceButton.layer.borderWidth = 1.0;
    ReduceButton.layer.borderColor = [UIColor clearColor].CGColor;
    ReduceButton.clipsToBounds = TRUE;//去除边界
    [ReduceButton setBackgroundImage:[UIImage imageNamed:@"ReduceButton.png"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.ReduceButton];
    //当前数量
    self.currentAmount = [[UILabel alloc] initWithFrame:CGRectMake(280, 35, 10, 10)];
    self.currentAmount.text = @"1";
    [self.contentView addSubview:self.currentAmount];
    //加按钮
    self.AddButton = [[UIButton alloc] initWithFrame:CGRectMake(290, 30, 20, 20)];
    _AddButton.layer.cornerRadius = 10;
    _AddButton.layer.borderWidth = 1.0;
    _AddButton.layer.borderColor = [UIColor clearColor].CGColor;
    _AddButton.clipsToBounds = TRUE;//去除边界
    [_AddButton setBackgroundImage:[UIImage imageNamed:@"AddButton.png"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.AddButton];
    
     self.PriceLable = [[UILabel alloc] initWithFrame:CGRectMake(320, 30, 25, 20)];
    self.PriceLable.text = @"";
    [self.contentView addSubview:self.PriceLable];
    //按钮不可点击
//    self.myOverButton.userInteractionEnabled=NO;
//    self.myOverButton.alpha=0.4;
    
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
